#include "repeatwid.h"

repeatWid::repeatWid(QString onIcon, QString offIcon, bool repeatIsActivated)
{
         onPix = new QPixmap(QString(QApplication::applicationDirPath() + "/themes" + onIcon));
         offPix = new QPixmap(QString(QApplication::applicationDirPath() + "/themes" + offIcon));

         this->updateStatus(repeatIsActivated);

}

void repeatWid::mousePressEvent(QGraphicsSceneMouseEvent * event)
{
    qDebug() << "repeatToggled()";
    emit this->repeatToggled();
}

void repeatWid::updateStatus(bool status)
{
    qDebug() << "repeat => updateStatus";
    if(status == true){
        this->setPixmap(*onPix);
    }else{
        this->setPixmap(*offPix);
    }
}
